package software.agileCourse2013.KillerGame.biz.Command.JsonParameterImpls;

import software.agileCourse2013.KillerGame.biz.Command.JsonParameter;
import net.sf.json.JSONObject;

public class testJsonPara implements JsonParameter{
	private String id;
	private String name;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Override
	public JsonParameter analysisParas(String JsonString) {
		testJsonPara res = new testJsonPara();
	    JSONObject report = JSONObject.fromObject(JsonString);
	      JSONObject user = report.getJSONObject("userInfo");
	      String data = report.getString("dataInfo");
		res.setId(user.getString("uid"));
		res.setName(user.getString("uname")+data);
		return res;
	}
	
	
}
